package com.fz.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fz.entity.Goods;
import com.baomidou.mybatisplus.extension.service.IService;
import io.minio.errors.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.math.BigDecimal;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 * 存储商户提交的商品信息 服务类
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
public interface GoodsService extends IService<Goods> {
    Boolean add(String name, String description, BigDecimal price, Integer store, Long categoryId, MultipartFile[] files) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    Boolean update(Long id, String name, String description, BigDecimal price, Integer store, Long categoryId, MultipartFile[] files, String[] urls) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    IPage<Goods> getList(Integer pageNo, Integer pageSize);

    Goods getById(Long id);

    List<Goods> list();

    IPage<Goods> getByCategoryId(Long categoryId, Integer pageNo, Integer pageSize);

    // 按类别查询商品
    IPage<Goods> getHotList(Integer pageNo, Integer pageSize);

    List<Goods> getMarketingGoods(Long marketingId);

    List<Goods> getHotSalesGoods();

    IPage<Goods> getByPriceOrderAndCategory(Long categoryId, Integer order, BigDecimal maxPrice, BigDecimal minPrice,Integer pageNo, Integer pageSize);

    IPage<Goods> searchByGoodsName(String searchValue, Integer pageNo, Integer pageSize);
}
